﻿CREATE TABLE [dbo].[ServiceCertificate] (
    [ServiceCertificateId] UNIQUEIDENTIFIER CONSTRAINT [DF_ServiceCertificate_ServiceCertificateId] DEFAULT (newid()) NOT NULL,
    [HostedServiceId]      UNIQUEIDENTIFIER NOT NULL,
    [FriendlyName]         VARCHAR (150)    NOT NULL,
    [HasPrivateKey]        TINYINT          NOT NULL,
    [Issuer]               VARCHAR (150)    NOT NULL,
    [IssuerName]           VARCHAR (150)    NOT NULL,
    [NotBeforeDateTime]    DATETIME         NOT NULL,
    [NotAfterDateTime]     DATETIME         NOT NULL,
    [RawData]              VARCHAR (MAX)    NOT NULL,
    [SerialNumber]         VARCHAR (150)    NOT NULL,
    [Subject]              VARCHAR (150)    NOT NULL,
    [SubjectName]          VARCHAR (150)    NOT NULL,
    [Thumbprint]           VARCHAR (150)    NOT NULL,
    [Version]              INT              NOT NULL,
    CONSTRAINT [PK_ServiceCertificate] PRIMARY KEY CLUSTERED ([ServiceCertificateId] ASC)
);

